import Vue from 'vue'
import App from './App.vue'
import router from './router'



import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.use(ElementUI);

// 定义格式化时间的过滤器
Vue.filter('timeFormat', function (value) {
  var date = new Date(value);
  var YY = date.getFullYear() + '-';
  var MM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
  var DD = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate());
  var hh = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
  var mm = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
  var ss = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
  return YY + MM + DD +" "+hh + mm + ss;   

})


import ZkTable from 'vue-table-with-tree-grid'

Vue.use(ZkTable)

// 引入全局css样式
import '@/assets/css/qj.css'
// 引入阿里图标库iconfont.css
import "@/assets/fonts/iconfont.css"
import '@/utils/add'

Vue.config.productionTip = false


// // 全局路由守卫
// router.beforeEach((to, from, next) => {
//   if (to.path.indexOf('/home') > -1) {
//     let token = sessionStorage.getItem("token");
//     //console.log("from");//即将要进入的路由对象
    

//     //登录监权
//     if (to.path == "/index") {
//       if (token != null) {
//         next("/home");
//       }
//     } else {
//       if (token == null) {
//         next("/index");
//       }

//     }
//   }
//   next();
// })


new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
